import Vue from 'vue'
import Router from 'vue-router'

import Main from '../components/Main';

import Student from "../components/Student";
import StuMain from '../components/Student/Main';
import StuCour from '../components/Student/Courses';
import StuHw from '../components/Student/Homework';
import StuAnn from '../components/Student/Announce';
import StuSet from '../components/Student/Setting';

import Teacher from "../components/Teacher";
import TeaMain from '../components/Teacher/TeaMain';
import TeaCourInfo from '../components/Teacher/CourseInfo';
import TeaCourFile from '../components/Teacher/CourseFile';
import TeaHWManage from '../components/Teacher/HWManage';
import TeaStuManage from '../components/Teacher/StuManage';
import TeaTAManage from '../components/Teacher/TAManage';
import TeaDis from '../components/Teacher/TeaDiscussion';

import Guest from "../components/Guest";
// Guest下子路由

import TA from '../components/TA'
// TA下子路由

import Admin from "../components/Admin";
// Admin下子路由

import CourseDetail from "../components/Student/CrsDetail.vue";
import HWDetail from "../components/Student/HWDetail.vue";

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Main',
      component: Main
    },
    {
      path: '/Student',
      name: 'Student',
      component: Student,
      redirect: '/Student/Courses',
      children: [{
        path: 'Main',
        component: StuMain
      }, {
        path: 'Courses',
        component: StuCour
      }, {
        path: 'Homework',
        component: StuHw
      }, {
        path: 'Announce',
        component: StuAnn
      }, {
        path: 'Setting',
        component: StuSet
      }]
    },
    {
      path: '/Teacher',
      name: 'Teacher',
      component: Teacher,
      redirect: '/Teacher/TeaMain',
      children: [{
        path: 'TeaMain',
        component: TeaMain
      }, {
        path: 'CourseInfo',
        component: TeaCourInfo
      }, {
        path: 'CourseFile',
        component: TeaCourFile
      }, {
        path: 'HWManage',
        component: TeaHWManage
      }, {
        path: 'StuManage',
        component: TeaStuManage
      }, {
        path: 'TAManage',
        component: TeaTAManage
      }, {
        path: 'TeaDiscussion',
        component: TeaDis
      }]
    },
    {
      path: '/Guest',
      name: 'Guest',
      component: Guest
    },
    {
      path: '/TA',
      name: "TA",
      component: TA,
    },
    {
      path: '/Admin',
      name: "Admin",
      component: Admin,
    },
    {
      path: '/CourseDetail',
      name: 'CourseDetail',
      component: CourseDetail,
    },
    {
      path: '/CourseDetail/HWDetail',
      name: HWDetail,
      component: HWDetail,
    }
  ]
})
